<template>
	<view>
		<!-- 自适应状态栏 -->
		<view class="status-height"></view>
		
		<homePage v-if="PageCur=='homePage'"></homePage>
		
		<management v-if="PageCur=='management'"></management>
		
		<message v-if="PageCur=='message'"></message>
		
		<my v-if="PageCur=='my'"></my>
		
		<view class="cu-bar tabbar bg-white shadow foot">
			
			<view class="action" @click="NavChange" data-cur="homePage">
				<view class='cuIcon-cu-image'>
					<image :src="'../../../static/tabbar/basics' + [PageCur=='homePage'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='homePage'?'text-green':'text-gray'">首页</view>
			</view>
			
			<view class="action" @click="NavChange" data-cur="management">
				<view class='cuIcon-cu-image'>
					<image :src="'../../../static/tabbar/component' + [PageCur == 'management'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='management'?'text-green':'text-gray'">管理</view>
			</view>
			
			<view class="action" @click="NavChange" data-cur="message">
				<view class='cuIcon-cu-image'>
					<image :src="'../../../static/tabbar/about' + [PageCur == 'message'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='message'?'text-green':'text-gray'">消息</view>
			</view>
			
			<view class="action" @click="NavChange" data-cur="my">
				<view class='cuIcon-cu-image'>
					<image :src="'../../../static/tabbar/plugin' + [PageCur == 'my'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='my'?'text-green':'text-gray'">我的</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				PageCur: 'homePage' 
			}
		},
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
			}
		}
	}
</script>

<style>
uni-view {
    line-height: 1;
}
</style>
